import torch
import torch.nn as nn
import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'

rnn = nn.LSTM(10, 5, 1, batch_first=True, bidirectional=True)
input = torch.randn(5, 3, 10)
h0 = torch.randn(2, 5, 5)
c0 = torch.randn(2, 5, 5)
output, (hn, cn) = rnn(input,(h0, c0))
print(output.shape)
print(output[-1::].shape)
print(hn.shape)